package com.spzx.product.api.factory;

import com.spzx.common.core.domain.R;
import com.spzx.product.api.RemoteProductService;
import com.spzx.product.api.domain.ProductSkuVo;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

//@Component
public class RemoteProductServiceFallbackFactory implements FallbackFactory<RemoteProductService> {
    @Override
    public RemoteProductService create(Throwable cause) {
        return new RemoteProductService() {
            @Override
            public R<ProductSkuVo> getProductSku(Long skuId, String source) {
                return R.fail("获取商品SKU详情失败" + cause.getMessage());
            }
        };
    }
}
